SubCrudService

Constructors

Link copied to clipboard
constructor(client: PocketbaseClient)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
inline suspend fun <T : BaseModel> _create(path: String, body: String, expandRelations: ExpandRelations = ExpandRelations(), showFields: ShowFields = ShowFields()): T
inline suspend fun <T : BaseModel> _create(path: String, body: Map<String, JsonPrimitive>, files: List<FileUpload>, expandRelations: ExpandRelations = ExpandRelations(), showFields: ShowFields = ShowFields()): T
Link copied to clipboard
inline suspend fun _delete(path: String, id: String): Boolean
Link copied to clipboard
inline suspend fun <T : BaseModel> _getFullList(path: String, batch: Int, sortBy: SortFields = SortFields(), filterBy: Filter = Filter(), expandRelations: ExpandRelations = ExpandRelations(), showFields: ShowFields = ShowFields(), skipTotal: Boolean = false): List<T>
Link copied to clipboard
inline suspend fun <T : BaseModel> _getList(path: String, page: Int, perPage: Int, sortBy: SortFields = SortFields(), filterBy: Filter = Filter(), expandRelations: ExpandRelations = ExpandRelations(), showFields: ShowFields = ShowFields(), skipTotal: Boolean = false): ListResult<T>
Link copied to clipboard
inline suspend fun <T : BaseModel> _getOne(path: String, id: String, expandRelations: ExpandRelations = ExpandRelations(), showFields: ShowFields = ShowFields()): T
Link copied to clipboard
inline suspend fun <T : BaseModel> _update(path: String, id: String, body: String, expandRelations: ExpandRelations = ExpandRelations(), showFields: ShowFields = ShowFields()): T
inline suspend fun <T : BaseModel> _update(path: String, id: String, body: Map<String, JsonPrimitive>, files: List<FileUpload>, expandRelations: ExpandRelations = ExpandRelations(), showFields: ShowFields = ShowFields()): T
Link copied to clipboard
abstract fun baseCrudPath(collectionId: String): String

The url path to the service's API

Link copied to clipboard
inline suspend fun <T : BaseModel> create(sub: String, body: String, expandRelations: ExpandRelations = ExpandRelations(), showFields: ShowFields = ShowFields()): T
inline suspend fun <T : BaseModel> create(sub: String, body: Map<String, JsonPrimitive>, files: List<FileUpload>, expandRelations: ExpandRelations = ExpandRelations(), showFields: ShowFields = ShowFields()): T

Creates a new record and gets the record

Link copied to clipboard
inline suspend fun delete(sub: String, id: String): Boolean

Deletes the specified record

Link copied to clipboard
inline suspend fun <T : BaseModel> getFullList(sub: String, batch: Int, sortBy: SortFields = SortFields(), filterBy: Filter = Filter(), expandRelations: ExpandRelations = ExpandRelations(), showFields: ShowFields = ShowFields(), skipTotal: Boolean = false): List<T>

Fetches all records in the collection at once

Link copied to clipboard
inline suspend fun <T : BaseModel> getList(sub: String, page: Int, perPage: Int, sortBy: SortFields = SortFields(), filterBy: Filter = Filter(), expandRelations: ExpandRelations = ExpandRelations(), showFields: ShowFields = ShowFields(), skipTotal: Boolean = false): ListResult<T>

Fetches a paged list of records

Link copied to clipboard
inline suspend fun <T : BaseModel> getOne(sub: String, id: String, expandRelations: ExpandRelations = ExpandRelations(), showFields: ShowFields = ShowFields()): T

Fetches a single record

Link copied to clipboard
inline suspend fun <T : BaseModel> update(sub: String, id: String, body: String, expandRelations: ExpandRelations = ExpandRelations(), showFields: ShowFields = ShowFields()): T
inline suspend fun <T : BaseModel> update(sub: String, id: String, body: Map<String, JsonPrimitive>, files: List<FileUpload>, expandRelations: ExpandRelations = ExpandRelations(), showFields: ShowFields = ShowFields()): T

Updates an existing records and gets it